-
Notifications
You must be signed in to change notification settings - Fork 177
Fix/885 update default bind address #892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
yashksaini-coder
wants to merge
9
commits into
libp2p:main
Choose a base branch
from
yashksaini-coder:fix/885-Update-default-Bind-address
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix/885 update default bind address #892
yashksaini-coder
wants to merge
9
commits into
libp2p:main
from
yashksaini-coder:fix/885-Update-default-Bind-address
+336
−43
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ead of wildcard (0.0.0.0) across multiple examples and utilities.
…sure secure binding addresses (127.0.0.1) are used instead of wildcard (0.0.0.0)
@yashksaini-coder : Great contribution, Yash. Appreciate your efforts. This PR is coming along nicely. Looking forward to detailed review by @acul71 on this PR. |
(venv) luca@r17:~/PNL_Launchpad_Curriculum/Libp2p/py-libp2p$ identify-demo
First host listening (using raw protobuf format). Run this from another console:
identify-demo --raw-format -d /ip4/127.0.0.1/tcp/37511/p2p/QmVUKiaLFMt9AVALFTPCRycCM2FArzugTLScVKaeeoCyxc or like that (venv) luca@r17:~/PNL_Launchpad_Curriculum/Libp2p/py-libp2p$ ping-demo
Run this from the same folder in another console:
ping-demo -d /ip4/0.0.0.0/tcp/42547/p2p/QmRShbR5CqVSkF4zWKCUhx7BwU9MonXV5LNxFDT1CborEk
Waiting for incoming connection... it should be instead similar to this: (venv) luca@r17:~/PNL_Launchpad_Curriculum/Libp2p/py-libp2p$ echo-demo
Listener ready, listening on:
/ip4/192.168.1.17/tcp/43857/p2p/16Uiu2HAmJcvmEow2iaFDEexsN2HMqzX8DcwxhDct87YYnoQNhv7m
/ip4/10.156.233.51/tcp/43857/p2p/16Uiu2HAmJcvmEow2iaFDEexsN2HMqzX8DcwxhDct87YYnoQNhv7m
/ip4/127.0.0.1/tcp/43857/p2p/16Uiu2HAmJcvmEow2iaFDEexsN2HMqzX8DcwxhDct87YYnoQNhv7m
Run this from the same folder in another console:
echo-demo -d /ip4/192.168.1.17/tcp/43857/p2p/16Uiu2HAmJcvmEow2iaFDEexsN2HMqzX8DcwxhDct87YYnoQNhv7m
Waiting for incoming connections... So that it shows all available interfaces and a default command for the client (
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
My previous PR #811 lacked the code changes on, multiple
examples
andcore
modules that were using wildcard addresses (0.0.0.0
) for binding, which could expose services on all network interfaces and create security vulnerabilities.How was it fixed?
I updated all the modules files and refactored to replace all wildcard bind addresses (
0.0.0.0
) with secure loopback addresses (127.0.0.1
) across the entire codebase:Examples Directory (17 files updated)
ping.py
,chat.py
,bootstrap.py
,mDNS.py
,pubsub.py
,random_walk.py
,identify.py
,identify_push_listener_dialer.py
examples/doc-examples/
directorynetwork_discover.py
(updated fallback functions)Core Library Updates
libp2p/utils/address_validation.py
: Updated fallback addresses from0.0.0.0
to127.0.0.1
Documentation Updates (5 files)
.rst
files indocs/examples.*.rst
to reflect new secure addressesTesting & Validation
tests/utils/test_default_bind_address.py
: Comprehensive tests for secure address selectiontests/examples/test_examples_bind_address.py
: Validation that all examples use secure addressesRelease Notes
newsfragments/885.feature.rst
: Security enhancement notificationTo-Do
cc: @acul71 @seetadev @pacrob